<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box1 {
            width: 100px;
            height: 100px;
            background-color: red;
        }
    
        .inner {
            width: 50%;
            height: 50%;
            background-color: green;
        }
    
        /* 谷歌浏览器默认字体16px */
    
        .box2 {
            width: 1em;
            height: 1em;
            background-color: orange;
        }
    
        /* 1em即父元素字体的大小 */
        .wrap {
            font-size: 100px;
        }
    
        html {
            font-size: 100px;
        }
    
        /* 1rem即跟标签的字体大小  html  */
        .box3 {
            width: 1rem;
            height: 1rem;
            background-color: yellow;
        }
    
        /* 1vh指页面高度的1% */
        .box4 {
            width: 50vh;
            height: 50vh;
            background-color: green;
        }
    
        /* 1vw指页面宽度的1% */
        .box5 {
            width: 1vw;
            height: 1vw;
            background-color: purple;
        }
    
        /* vmin vh和vw中谁小参考谁 */
        .box6 {
            width: 10vmin;
            height: 10vmin;
            background-color: pink;
        }
    
        /* vmax vh和vw中谁大参考谁 */
        .box7 {
            width: 10vmax;
            height: 10vmax;
            background-color: black;
        }
    </style>
</head>
<body>
     <!--  <div class="box1">
        <div class="inner"></div>
    </div>
    <div class="wrap">
        <div class="box2"></div>
    </div>
    <div class="box3"></div>
    <div class="box4"></div>
    <div class="box5"></div> -->
    <div class="box6"></div>
    <div class="box7"></div>
    
</body>
</html>